package com.example.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;

/**
 * 
 * @TableName t_type
 */
@TableName(value ="t_type")
@Data
public class Type implements Serializable {
    /**
     * 
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 分类名称
     */
    private String typeName;

    /**
     * 图片
     */
    private String typeLogo;

    /**
     * 计量单位
     */
    private String typeUnit;

    /**
     * 关键词
     */
    private String typeKey;

    /**
     * 分类描述
     */
    private String typeInfo;

    /**
     * 启用:1,未启用:0
     */
    private Integer typeStatus;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Type other = (Type) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getTypeName() == null ? other.getTypeName() == null : this.getTypeName().equals(other.getTypeName()))
            && (this.getTypeLogo() == null ? other.getTypeLogo() == null : this.getTypeLogo().equals(other.getTypeLogo()))
            && (this.getTypeUnit() == null ? other.getTypeUnit() == null : this.getTypeUnit().equals(other.getTypeUnit()))
            && (this.getTypeKey() == null ? other.getTypeKey() == null : this.getTypeKey().equals(other.getTypeKey()))
            && (this.getTypeInfo() == null ? other.getTypeInfo() == null : this.getTypeInfo().equals(other.getTypeInfo()))
            && (this.getTypeStatus() == null ? other.getTypeStatus() == null : this.getTypeStatus().equals(other.getTypeStatus()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getTypeName() == null) ? 0 : getTypeName().hashCode());
        result = prime * result + ((getTypeLogo() == null) ? 0 : getTypeLogo().hashCode());
        result = prime * result + ((getTypeUnit() == null) ? 0 : getTypeUnit().hashCode());
        result = prime * result + ((getTypeKey() == null) ? 0 : getTypeKey().hashCode());
        result = prime * result + ((getTypeInfo() == null) ? 0 : getTypeInfo().hashCode());
        result = prime * result + ((getTypeStatus() == null) ? 0 : getTypeStatus().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", typeName=").append(typeName);
        sb.append(", typeLogo=").append(typeLogo);
        sb.append(", typeUnit=").append(typeUnit);
        sb.append(", typeKey=").append(typeKey);
        sb.append(", typeInfo=").append(typeInfo);
        sb.append(", typeStatus=").append(typeStatus);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}